﻿#ifndef PLCSERVERSTATUSWIDGET_H
#define PLCSERVERSTATUSWIDGET_H

#include <QGroupBox>
#include <QLabel>
#include <QMap>
#include <QVBoxLayout>

class PLCServerOneStatusWidget : public QWidget
{
    Q_OBJECT
public:
    explicit PLCServerOneStatusWidget(const QString& name = "",QWidget *parent = nullptr);
    void setText(const QString& status);
private:
    QLabel* lblStatus;
};

class PLCServerStatusWidget : public QGroupBox
{
    Q_OBJECT
public:
    explicit PLCServerStatusWidget(const QString& name = "", QWidget *parent = nullptr);

    void addOne(QString name);
    void removeOne(QString name);
    void setStatus(QString name, QString status);
signals:
private:
    QMap<QString, PLCServerOneStatusWidget*> mMapWgtPLCServerStatus;
    QVBoxLayout* mLayout;

};

#endif // PLCSERVERSTATUSWIDGET_H

